#!/usr/bin/env bash
# 引入所有.sh文件
echo "公共脚本目录：$1"
if [ "$(ps -p $$ -o comm=)" = "zsh" ]; then
  sh_files=($(find "$1" -name "*.sh" -type f))
else
  sh_files=$(find "$1" -name "*.sh" -type f)
fi

for file in $sh_files; do
  if [ "$file" != "$1/index.sh" ]; then # 排除当前文件
    source "$file"
  fi
done
